/**
 * Created by wxl on 2016/12/16.
 */
import {
    SEARCH_DATA_SUCCESS,
    SEARCH_DATA_REQUEST
} from '../actions/types'
import { createReducer } from 'redux-immutablejs'
import {fromJS} from 'immutable'

const initialState = fromJS({
     searchData:[],
     hotData:[],
     start:0
})

export const search= createReducer(initialState,{
    [SEARCH_DATA_SUCCESS]: (state,action)=>{
        var obj=state.toJS();
        return state.merge({
            searchData:obj.searchData.concat(action.req.data.info),
            start:obj.start+15
        })
    }
})

